package com.ndf.learn.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by lin on 17-12-29.
 */
@Controller
public class IndexController {

    @RequestMapping(value = {"/"} , method = {RequestMethod.GET})
    public ModelAndView hello(HttpServletRequest request
            , HttpServletResponse response) throws Exception{
        ModelAndView mv = new ModelAndView();
        mv.addObject("msg", "Hello World");
        mv.setViewName("index.jsp");
        return mv;
    }

}
